<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="../../js/jquery-3.4.1.min.js"></script>
  <style>
    .date{background-color: blue;height: 50px;line-height: 50px;text-align: center;}
    .box img{border-radius: 100%;}
  </style>
</head>
<body>
  <div class="date"></div>
 
  <script>
    $.ajax({
      type: "get",
      url: "https://zhihu-daily.leanapp.cn/api/v1/last-stories",
      data: "",
      dataType: "json",
      success: function (response) {
        // console.log(response.STORIES.date);
        var obj_STORIES = response.STORIES;
        var date = obj_STORIES.date;//日期
        $(".date").html(date);
        var arr_stories = obj_STORIES.stories;//
        var str = "";//用于存放结果
        for(let i in arr_stories){
          var obj = arr_stories[i];
          // console.log(obj.title);
          // console.log(obj.images[0]) ;
          let title = obj.title;//标题
          let img_url = obj.images[0];//图片的url
          let url = obj.url;//详情页面的地址
          str += '<div class="box"><a href="'+url+'" target="_blank"><img src="'+img_url+'" alt=""></a><span>'+title+'</span></div>'
         
        }
        $("body").append(str);
      },
      error: function(){

      }
    });  
  </script>
</body>
</html>